package com.itheima.genericdemo;

public class BOX <E> {
    private E element;

    public BOX() {
    }

    public BOX(E element) {
        this.element = element;
    }

    public E getElement() {
        return element;
    }

    public void setElement(E element) {
        this.element = element;
    }
}

class Test{
    public static void main(String[] args) {
        BOX<String> stringBOX = new BOX<>();
        stringBOX.setElement("存放字符串的盒子");
        String element = stringBOX.getElement();
        System.out.println(element);
    }
}